package com.exercise.api.feign;


import com.exercise.api.feignParam.OrderModule;
import com.exercise.commons.param.QueryOrderParam;
import com.exercise.commons.vo.Order;
import com.exercise.commons.vo.Paging;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "DeWu-storage-service",contextId = "orderApi")
public interface OrderApiFeign {

    /**
     * 下单
     *
     * @param order 接收的Order模型
     * @return
     */
    @GetMapping("/order/add")
    public Order add(@RequestBody Order order);

    /**
     * 查询订单
     *
     * @param queryOrderParam 查询参数
     * @return
     */
    @GetMapping("/order/queryRecentPaySuccess")
    Paging<Order> queryRecentPaySuccess(@RequestBody QueryOrderParam queryOrderParam);

    /**
     * 根据订单号查询
     *
     * @return
     */
    @GetMapping("/order/getByOrderNumber")
    Order getByOrderNumber(@RequestBody String orderNumber);

    /**
     * 更新订单状态
     *
     * @param orderNumber 订单号
     * @param orderStatus 订单状态
     * @return Order
     */
    @GetMapping("/order/updateOrderStatus")
    Order updateOrderStatus(@RequestBody OrderModule orderModule);
    //Order updateOrderStatus(String orderNumber, @RequestBody OrderStatus orderStatus);


    /**
     * 更新
     * @param orderNumber
     * @return
     */
    @GetMapping("/order/updateProductPersonNumber")
    Order updateProductPersonNumber(@RequestBody String orderNumber);
}
